package staticdemo;
//静态代码块   随着类的加载而执行
public class Bank {
    private String name;
    private double acount;
    static {
        System.out.println("欢迎光临");
    }

    public Bank() {
        System.out.println("构造函数");
    }

    public Bank(String name, double acount) {
        this.name = name;
        this.acount = acount;
    }
    public void saveMoney(double m){
        acount+=m;
        System.out.println("您账户的余额为"+acount);
    }

}
